import request from '@/utils/request'

//创建活动
export function crateActivity (activity) {
  return request({
    url: '/activity/createNewActivity',
    method: 'post',
    data:activity
  })
}

//修改活动
export function updateActivity (activity) {
  return request({
    url: '/activity/updateActivity',
    method: 'post',
    data:activity
  })
}

//用户查询活动
export function userFindActivity (param) {
    return request({
        url:'/activity/userFindWaitAuditActivity',
        method:'post',
        data:param
    })
}

//管理员查询活动
export function adminFindActivity (param) {
  return request({
      url:'/activity/userFindWaitAuditActivityAdmin',
      method:'post',
      data:param
  })
}

export function findActivityById(activityId) {
  return request({
    url:'/activity/findActivityById',
    method:'post',
    data:activityId
  })
}

//审批活动
export function approvalActivity(data) {
  return request({
    url: '/activity/activityApproval',
    method: 'post',
    data:data
  })
}

//发布活动
export function releaseActivity(data) {
  return request({
    url:'/activity/activityRelease',
    method: 'post',
    data:data
  })
}

//活动统计数
export function coutActivityNumber(data){
  return request({
    url:'/activity/activityTicketRestrict',
    method: 'post',
    data:data
  })
}

//活动统计表内容
export function countActivityList(data){
  return request({
    url:'/activityTicket/activityOfTicketList',
    method: 'post',
    data:data
  })
}

//导出活动统计
export function outputCountActivity(data){
  return request({
    url:'/activity/outputTicket',
    method: 'post',
    data:data,
    responseType: 'blob'
  })
}

//获取活动审核内容
export function findActivityAudit(data){
  return request({
    url:'/activity/findActivityAudit',
    method: 'post',
    data:data,
  })
}

// 置顶活动到首页

export function activityTopIndex(data){
  return request({
    url:'/activity/isTop',
    method: 'post',
    data:data,
  })
}

